<?php namespace App\Repositories\User;

use App\Repositories\Eloquent\User\Entity\SocialiteUser;

interface SocialiteUserRepositoryInterface
{
    /**
     * @param $id
     *
     * @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Model[]|null
     */
    public function show($id);

    /**
     * 查找第三方用户,不过不能存在,则创建
     *
     * @param \App\Repositories\Eloquent\User\Entity\SocialiteUser $socialite_user
     *
     * @return \Illuminate\Database\Eloquent\Model
     */
    public function createOrFind(SocialiteUser $socialite_user);

    /**
     * @param int|\App\Models\SocialiteUser $model
     * @param                               $user_id
     *
     * @return bool
     */
    public function bindUser($model, $user_id);

    /**
     * 获取用户在微信公众平台的open id
     *
     * @param $user_id
     *
     * @return string|null
     */
    public function getWechatMpOpenId($user_id);

    /**
     * 通过user_id获取第三方用户信息
     *
     * @param $user_id
     *
     * @return mixed
     */
    public function getUserByUserId($user_id);

}
